package cn.stylefeng.guns.modular.order.mapper;

import cn.stylefeng.guns.modular.order.entity.Eshopbuyer;
import cn.stylefeng.guns.modular.order.entity.TbOrder;
import cn.stylefeng.guns.modular.order.entity.TbOrderApi;
import cn.stylefeng.guns.modular.order.model.params.TbOrderParam;
import cn.stylefeng.guns.modular.order.model.result.TbOrderResult;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author zhou
 * @since 2019-08-02
 */
@Repository
public interface TbOrderMapper extends BaseMapper<TbOrder> {
    /**
     * 查看详情
     * @param tbOrderParam
     * @return
     */
    TbOrderResult detail(TbOrderParam tbOrderParam);

    /**
     * 获取列表
     *
     * @author zhou
     * @Date 2019-08-02
     */
    List<TbOrderResult> customList(@Param("paramCondition") TbOrderParam paramCondition);


    /**
     * 上传订单
     *
     * @author zhou
     * @Date 2019-08-02
     */
    List<TbOrderApi> uploadDetail(@Param("myArray") List<String> myArray);

    /**
     * 获取map列表
     *
     * @author zhou
     * @Date 2019-08-02
     */
    List<Map<String, Object>> customMapList(@Param("paramCondition") TbOrderParam paramCondition);

    /**
     * 获取分页实体列表
     *
     * @author zhou
     * @Date 2019-08-02
     */
    Page<TbOrderResult> customPageList(@Param("page") Page page, @Param("paramCondition") String paramCondition);

    /**
     * 获取分页map列表
     *
     * @author zhou
     * @Date 2019-08-02
     */
    Page<Map<String, Object>> customPageMapList(@Param("page") Page page, @Param("paramCondition") TbOrderParam paramCondition);



    /**
     * 修改状态为10
     *
     * @author zhou
     * @Date 2019-08-02
     */
    void updateStatus(@Param("myArray") List<String> myArray,@Param("status") String status);

    /**
     * 添加订单
     */
    void addOrder (@Param("t") TbOrderParam tbOrderParam);

    /**
     * 删除订单
     */
    void deleteOrders (@Param("t") TbOrderParam tbOrderParam);

    /**
     * 修改销售备注
     */
    void updateS (@Param("t") TbOrderParam tbOrderParam);
    /**
     * 查询用户信息
     */
     Eshopbuyer selectWxUser(@Param("id") String id);

    /**
     * 查看订单
     *
     * @author zhou
     * @Date 2019-08-02
     */
    List<Map<String, Object>> getOrderList(@Param("userId") String userId,@Param("status") String status);

    /**
     * 修改订单状态
     *
     * @author zhou
     * @Date 2019-08-02
     */
    void updateOrders(@Param("paramCondition") TbOrderParam paramCondition);



}
